package com.im.business.api.controller;

import com.im.business.api.feign.OfflineMessageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 离线消息controller组件
 * @Created leijun
 * @Date 2021/11/3 8:35 上午
 */
@RestController("api/offline")
public class OfflineMessageController {

    @Autowired
    private OfflineMessageService offlineMessageService;

    /**
     * 查询单聊离线消息
     * @param receiverId
     * @return
     */
    @RequestMapping("singleMessage")
    public List<String> selectOfflineSingleMessage(Long receiverId) {
        return offlineMessageService.selectOfflineSingleMessage(receiverId);
    }

    /**
     * 查询群聊离线消息
     * @param groupId
     * @return
     */
    @RequestMapping("groupMessage")
    public List<String> selectOfflineGroupMessage(Long groupId) {
        return offlineMessageService.selectOfflineGroupMessage(groupId);
    }
}
